#include <iostream>
#include <gtest/gtest.h>

class GlobalTestEnv : public testing::Environment
{
public:
    virtual void SetUp() override
    {
        std::cout << "SetUp: 测试环境初始化..." << std::endl;
    }

    virtual void TearDown() override
    {
        std::cout << "TearDown: 测试环境清理..." << std::endl;
    }
};

TEST(GlobalTestEnv, test1)
{
    std::cout << "test1..." << std::endl;
}

TEST(GlobalTestEnv, test2)
{
    std::cout << "test2..." << std::endl;
}

int main(int argc, char* argv[])
{
    testing::InitGoogleTest(&argc, argv);
    testing::AddGlobalTestEnvironment(new GlobalTestEnv());
    RUN_ALL_TESTS();

    return 0;
}